#lang racket

(define (exp b n)
  (define (iter i result)
    (if (= i n)
        result
        (iter (+ i 1) (* b result))))
  (iter 1 b))

(define (int-log b n)
  (define (iter i rest)
    (if (= (remainder rest b) 0)
        (iter (+ i 1) (/ rest b))
        i))
  (iter 0 n))

(define (cons a b) (* (exp 2 a) (exp 3 b)))

(define (car pair) (int-log 2 pair))

(define (cdr pair) (int-log 3 pair))

(define p (cons 4 5))

(car p)

(cdr p)